package model;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author Charlie Hatcher
 * 
 */
public class DashedLine extends LinePen {

	public DashedLine(Model model) {
		super(model);

	}

	private static final int CAP_SQUARE = 0;
	private static final int JOIN_MITER = 0;
	private static final float DASH_PHASE = 1;
	private static final float VISIBLE_LINE = 12;
	private static final float INVISIBLE_LINE = 12;
	private static final float MITER_LIMIT = 10;
	float[] myList = { VISIBLE_LINE, INVISIBLE_LINE };

	@Override
	/**
	 * Sends the necessary information to the thread to draw the movement of the turtles line
	 */
	public void drawLineMovement(Pixmap pixmap, int speed, Point starting,
			int dx, int dy) {
	       if (MyPenLevel == false) return;
	        Graphics2D graphic = pixmap.getBackgroundImage().createGraphics();
	        BasicStroke dash = new BasicStroke(getThickness(), CAP_SQUARE,
	                                           JOIN_MITER, MITER_LIMIT, myList, DASH_PHASE);
	        graphic.setStroke(dash);
	        graphic.setPaint(getColor());
	        graphic.drawLine((int) (starting.x), (int) (starting.y),
	                         (int) (starting.x+dx), (int) (starting.y + dy));
//	        
//
//		ThreadClass tc = new ThreadClass(pixmap, speed, starting, dx, dy,
//				getColor(), dash, getModel());
//		(new Thread(tc)).start();

	}

}
